<mat-toolbar class="title" color="primary">
  <div>Settings</div>
  <button mat-icon-button (click)="onNoClick()">
    <mat-icon>close</mat-icon>
  </button>
</mat-toolbar>

<div mat-dialog-content>
  <div class="example-container">
    <mat-form-field>
      <mat-label>Panel Title</mat-label>
      <input matInput [(ngModel)]="resultConfig.title" (keydown)="onChange()">
    </mat-form-field>

    <mat-checkbox [(ngModel)]="resultConfig.isButton" labelPosition="Before" (click)="onChange()">Search Button</mat-checkbox>
    <mat-form-field>
      <mat-label>Columns</mat-label>
      <input matInput [(ngModel)]="resultConfig.countFieldColumns" type="number" (keydown)="onChange()">
    </mat-form-field>
    <mat-form-field>
      <mat-label>Proto</mat-label>
      <mat-select
          [compareWith]="compareProto"
          [(ngModel)]="proto"
          (valueChange)="validate()"
          (selectionChange)="validate()"
        name="hep_alias"
        ngDefaultControl>
        <mat-option *ngFor="let protoItem of mappingSortedData" [value]="protoItem">
          {{protoItem.hep_alias}} - {{protoItem.profile}}
        </mat-option>
      </mat-select>
    </mat-form-field>
    <div *ngIf="proto">
      <app-drag-drop-list
        [sortlistactive]="data.config.fields"
        [list]="proto.fields_mapping"
        (change)="onUpdateProto($event)"
      ></app-drag-drop-list>
    </div>
  </div>
</div>

<div mat-dialog-actions  style="float:right" class="setting-buttons">
  <button mat-raised-button (click)="onNoClick()">Cancel</button>
  <button mat-raised-button color="primary" [mat-dialog-close]="resultConfig" [disabled]="!isValidForm" cdkFocusInitial>Save</button>
</div> 